<?php
/*
    BlogEffects 0.1b2
    http://blogeffects.net/
    Copyright (C) 2007 Chad Ohman (chad@chadohman.com) All rights reserved.

    BlogEffects is distributed WITHOUT WARRANTY WHATSOEVER.

    Last developer edit: January 2, 2008 9:50a

    ** This file can be edited freely **
*/

function draw_site($numposts) {
	global $config;
	require_once("template/header.php");
	$result = mysql_query("SELECT * FROM `posts` ORDER BY `timestamp` DESC LIMIT ".$numposts);
	$posts = "\n";
	while ($post = mysql_fetch_array($result)) {
		$posts .= '<div class="post '.$post['id'].'">'."\n";
		$posts .= '<div id="title"><a href="?post='.$post['id'].'">'.$post['title'].'</a></div>'."\n";
		$posts .= '<div id="meta">'.date("F j, Y", $post['timestamp']).'</div>'."\n";
		$posts .= '<div id="text">'."\n";
		$posts .= $post['text']."\n";
		$posts .= '</div>'."\n".'</div>'."\n";
	}
	echo $posts;
	require_once("template/footer.php");
}

?>